package cn.com.czpb.client.module.news.view;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import cn.com.czpb.client.R;
import cn.com.czpb.client.utils.PageCtrl;

/**
 * Created by 猪猪侠 on 2017/7/25.
 */

public class SubscribeTopView implements View.OnClickListener {
    private View rootView;
    private Activity mActivity;
    private LinearLayout ll_subscribe_id;
    private LinearLayout ll_suprise_id;

    public static SubscribeTopView instance(Activity activity){

        return new SubscribeTopView(activity);
    }

    public SubscribeTopView(Activity activity){
        //
        this.mActivity = activity;
        initView(activity);
    }
    public void setVisibile(boolean bool){
        if (bool){
            ll_suprise_id.setVisibility(View.VISIBLE);
        }else{
            ll_suprise_id.setVisibility(View.GONE);
        }

    }


    public View getView(){
        return rootView;
    }
    /**
     * @param context
     */
    private void initView(Activity context) {
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        rootView = layoutInflater.inflate(R.layout.view_subscribe_top,null);
        ll_subscribe_id = rootView.findViewById(R.id.ll_subscribe_id);
        ll_suprise_id = rootView.findViewById(R.id.ll_suprise_id);
        ll_subscribe_id.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.ll_subscribe_id://高层
                PageCtrl.start2SubscribeMoreActivity(mActivity);
                break;
        }
    }

}
